<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .clearfix::before {
            content: '';
            display: table;
        }

        .clearfix::after {
            clear: both;
        }

        .clearfix {
            *zoom: 1;
        }
        header{
            height: 100px;
            background-color: pink;
            overflow: hidden;
        }

        /* 嵌套元素的外边距合并，可以给父元素一个overflow:hidden */
        nav{
            width: 1360px;
            height: 46px;
            background-color: purple;
            margin: 30px auto 0;
        }
    </style>
</head>

<body>
    <header>
        <nav></nav>
    </header>
</body>

</html>